﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartPatientCentre.Models
{
    public class UniqueResult
    {
        public string ResultType { get; set; }
        public DateTime Date { get; set; }
        public string ShortDate
        {
            get
            {
                return Date.ToString("d");
            }
        }
        public decimal Value { get; set; }
        public string ValueString
        {
            get
            {
                if (ResultType == "Sodium")
                {
                    return Value.ToString("###");
                }
                else if (ResultType == "Potassium")
                {
                    return Value.ToString("##.#");
                }
                else if (ResultType == "Urea")
                {
                    return Value.ToString("##.#");
                }
                else // Creatinine
                {
                    return Value.ToString("###.#");
                }
            }
        }

        public string TileBackground { get; set; }
        public decimal Difference { get; set; }
        public string DifferenceString
        {
            get
            {
                return Difference.ToString("+#0.0#;-#0.0#");
            }
        }
        public string Sign
        {
            get
            {
                if (Difference < 0)
                {
                    return "ms-appx:///Assets/Down.png";
                }
                if (Difference > 0)
                {
                    return "ms-appx:///Assets/Up.png";
                }
                else
                {
                    return "ms-appx:///Assets/Equal.png";
                }
            }
        }
    }
}
